Skip to content

Start using app.commands.execute for all commands called from extension.ts#2207

Merged
robertbrignull merged 5 commits intomainfrom
robertbrignull/extension_commands
Mar 22, 2023
Merged

Start using app.commands.execute for all commands called from extension.ts#2207
robertbrignull merged 5 commits intomainfrom
robertbrignull/extension_commands

Conversation

@robertbrignull
Copy link
Copy Markdown
Contributor

We want to replace all calls to commands.executeCommand with app.commands.execute so we can take advantage of the new typing. This PR converts the few calls from extension.ts to the new method. This is just a first small PR to test the approach and make sure we're happy.

I've introduced the separation between commands where we are providing the implementation, and commands that are provided for us but we still want to get strong typing.

If we're happy with the groundwork laid by this PR then we should be able to start converting more command usages.

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

@robertbrignull robertbrignull requested a review from a team March 22, 2023 14:22
@robertbrignull robertbrignull requested a review from a team as a code owner March 22, 2023 14:22
Copy link
Copy Markdown
Contributor

@charisk charisk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me!

Comment thread extensions/ql-vscode/src/common/commands.ts Outdated

export type AllCommands = BaseCommands &
// All commands where the implementation is provided by this extension.
export type AllCodeQLCommands = BaseCommands &
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this perhaps be called AllExtensionCommands or just ExtensionCommands? I believe we're mostly using extension to refer to the extension (like in ExtensionApp), rather than CodeQL (since this can also refer to the CLI).

@robertbrignull
Copy link
Copy Markdown
Contributor Author

Thanks @koesie10 and @charisk for the suggestions on naming. Those are both much better ideas.

@robertbrignull robertbrignull disabled auto-merge March 22, 2023 16:34
@robertbrignull robertbrignull merged commit 297fa2e into main Mar 22, 2023
@robertbrignull robertbrignull deleted the robertbrignull/extension_commands branch March 22, 2023 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants